﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Public;
using System.Data;


namespace DAL
{
    public class DonGiaDAL
    {
        clsKetNoi kn = new clsKetNoi();

        public int DonGia_Them(DonGiaPublic p)
        {
            int Nparameter = 2;
            string[] name = new string[Nparameter];
            object[] value = new object[Nparameter];
            name[0] = "@MaChuyenBay"; value[0] = p.MaChuyenBay;
            name[1] = "@DonGia"; value[1] = p.DonGia;
            return kn.Update("DonGia_Insert", name, value, Nparameter);
        }
        public int DonGia_Edit(DonGiaPublic p)
        {
            int Nparameter = 2;
            string[] name = new string[Nparameter];
            object[] value = new object[Nparameter];
            name[0] = "@MaChuyenBay"; value[0] = p.MaChuyenBay;
            name[1] = "@DonGia"; value[1] = p.DonGia;
            return kn.Update("DonGia_Edit", name, value, Nparameter);
        }
        public int DonGia_Xoa(DonGiaPublic p)
        {
            int Nparameter = 1;
            string[] name = new string[Nparameter];
            object[] value = new object[Nparameter];
            name[0] = "@MaChuyenBay"; value[0] = p.MaChuyenBay;

            return kn.Update("DonGia_Xoa", name, value, Nparameter);
        }
    }
}
